/*
 * Copyright © 2020 ctwing
 */
package scep.ctwing.cn.smartapp;

import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import scep.ctwing.cn.smartapp.job.SortJob;

/**
 * @author:dailm
 * @create at :2020/12/4 11:48
 */
@RestController
@RequestMapping("/sort")
public class SortController {

    @GetMapping("/start.do")
    public String doSort(@RequestParam(name = "threadnum") int threadnum,@RequestParam(name="len") int len){
        SmartappApplication.THREAD_NUM = threadnum;
        SmartappApplication.DATA_LEN = len;
        SortJob sortJob = new SortJob();
        sortJob.doSortByHandle();
        return "OK";
    }

    @GetMapping("/config")
    public String setAutoSort(@RequestParam(name = "isAuto") String isAuto){
        SmartappApplication.isAuto = isAuto.toUpperCase();
        return "OK";
    }
}
